package cn.xxstudy.blog.dao

import cn.xxstudy.blog.entity.Category
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query

/**
 * 作者：wuxinxi on 2020/11/25
 * 包名：cn.xxstudy.blog.dao
 * TODO:分类查询
 */
interface CategoryRepository : JpaRepository<Category, Long> {
    fun findCategoryByCategoryName(categoryName: String): Category?

    @Query("select c from Category c ")
    fun findTop(pageable: Pageable): List<Category>

    fun deleteByCategoryName(categoryName: String):Int


}